package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.MsgListVO;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2019/4/26 16:47
 * 修改备注：
 * ================================================
 */

public class MsgListHolder extends BaseViewHolder<MsgListVO> {

    private TextView tvName;
    private TextView tvTime;
    private TextView tvUser;


    public MsgListHolder(ViewGroup parent) {
        super(parent, R.layout.item_msg_list);
        tvName = $(R.id.tv_name);
        tvTime = $(R.id.tv_time);
        tvUser = $(R.id.tv_user);

    }

    @Override
    public void setData(MsgListVO data) {
        super.setData(data);

        tvName.setText(data.getMessageName());
        tvTime.setText(data.getMessageDate());
        tvUser.setText("操作人：" + data.getOperaterName());

        if ("0".equals(data.getIslook())) {
            // isLook = 0 未查看
            tvName.setTextColor(getContext().getResources().getColor(R.color.colorFontBlack));
        } else {
            tvName.setTextColor(getContext().getResources().getColor(R.color.colorFontGray));

        }

    }

}
